<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('click_learns', function (Blueprint $table) {
            $table->id();
            $table->text('content')->comment('内容');
            $table->text('translation')->nullable()->comment('翻译');
            $table->string('phonetic')->nullable()->comment('音标');
            $table->string('audio_url')->nullable()->comment('音频地址');
            $table->string('image_url')->nullable()->comment('图片地址');
            $table->text('sentence')->nullable()->comment('单词例句');
            $table->text('sentence_translation')->nullable()->comment('例句翻译');
            $table->tinyInteger('type')->default(0)->comment('类型 0句子SENTENCE 1单词WORD');
            $table->tinyInteger('word_type')->default(0)->comment('类型 0 1IMPORTANT 不清楚什么作用');
            $table->tinyInteger('is_download')->default(0)->comment('是否下载');
            $table->tinyInteger('is_recite')->default(0)->comment('是否背诵');
            $table->string('word_blanks')->nullable()->comment('拼写题型');
            $table->text('spell_audio')->nullable()->comment('拼写音频名称');
            $table->string('option')->nullable();
            $table->string('option_order')->nullable();
            $table->string('practice_translation')->nullable()->comment('文件名称');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('click_learns');
    }
};
